toast.js ➔ useToast   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 6
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
1
import { useRef } from "react";
2
import useToastFunction from "./toastFunction";
3
import useToastType from "./toastType";
4
5
function useToast(options = {}) {
6
    const toastRef = useRef();
7
    const toast = useToastFunction(toastRef);
8
    const toastType = useToastType(toast, options);
9
    return [toastType, toastRef];
10
}
11
12
export default useToast;